<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.ArrayList"%>
<%@page import="model.ThanhVienModel"%>
<%@page import="dao.ThanhVienDao"%>
<%@page import="java.awt.Checkbox"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.rowTint{
		background: yellow;
	}
</style>


<style type="text/css">
	*{margin:0; padding:0;}
	body{
		background: #ddd;
	}
	
	#loadDataTable{
		color: #000;
	}
</style>
</head>
<body>
	<div>
		<h1 align="center">Thông Tin Thành Viên</h1>
		<h3>Xin chào: 
			<%
				//String tenDangNhap = request.getAttribute("tenDangNhap").toString();
				//String vaiTro = request.getAttribute("vaitro").toString();
				
				String tenDangNhap = request.getSession().getAttribute("tenDangNhap").toString();
				String vaiTro = request.getSession().getAttribute("vaitro").toString();
				
				out.println(tenDangNhap);
			%>
			<span style="color:red;">, Vai trò là: <%=vaiTro%></span>
		</h3>
		
	</div>
	
	<div id="loadDataTable">
		<table border="1" bgcolor="red">
			<tr>
				<th>&nbsp;</th>
				<th>ID</th>
				<th>Ten DN</th>
				<th>Mat Khau</th>
				<th>Vai Tro</th>
				<th>Ghi Chu</th>
			</tr>
			<%
				ArrayList<ThanhVienModel> listThanhVien = ThanhVienDao.getAllThanhvien();
				
				for(ThanhVienModel model: listThanhVien){
					out.print("<tr>");
					out.print("<td><input type='checkbox' name='aaa' value='"+model.getId()+"' /></td>");
					out.print("<td>"+model.getId()+"</td>");
					out.print("<td>"+model.getTendn()+"</td>");
					out.print("<td>"+model.getMatkhau()+"</td>");
					out.print("<td>"+model.getVaitro()+"</td>");
					out.print("<td>"+model.getGhichu()+"</td>");
					out.print("</tr>");
				}
			%>
		</table>
	
	</div>
	
	<a href="addUser.jsp">.Thêm mới thành viên</a>
</body>
</html>